import { createRouter, createWebHashHistory } from 'vue-router'

const Layout = () => import('@/views/Layout')
const Home = () => import('@/views/home/index')
const category = () => import('@/views/category/index')
const SubCategory = () => import('@/views/category/sub')
const Test = () => import('@/views/test')
// const List = () => import('@/views/test/list.vue')
const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: '/',
        component: Home
      }
    ]
  },
  {
    path: '/category/:id',
    component: category
  },
  {
    path: '/category/sub/:id',
    component: SubCategory
  },
  {
    path: '/test',
    component: Test
  }
  //   {
  //     path: '/test/list',
  //     component: List
  //   }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
